//
//  MZDrawerView.m
//  MZ_CT
//
//  Created by lanou3g on 15/12/15.
//  Copyright © 2015年 lanou3g. All rights reserved.
//

#import "MZDrawerView.h"

@implementation MZDrawerView

- (UIImageView *)headView{
    if (!_headView) {
        _headView = [[UIImageView alloc] initWithFrame:CGRectMake(50 ,60 * ([UIScreen mainScreen].bounds.size.height / 667.0), 50, 50)];
        [self addSubview:_headView];
    }
    return _headView;
}

- (UIButton *)LoginOrRegister{
    if (!_LoginOrRegister) {
        _LoginOrRegister = [UIButton buttonWithType:UIButtonTypeCustom];
        _LoginOrRegister.frame = CGRectMake(CGRectGetMaxX(_headView.frame), CGRectGetMinY(_headView.frame) + 20 ,100, 30);
        _LoginOrRegister.titleLabel.textAlignment =  NSTextAlignmentLeft;
        [self addSubview:_LoginOrRegister];
    }
    return _LoginOrRegister;
}

- (UIButton *)collection{
    if (!_collection) {
        _collection = [UIButton buttonWithType:UIButtonTypeCustom];
        _collection.frame = CGRectMake(CGRectGetMinX(_headView.frame), CGRectGetMaxY(_headView.frame) + 20,30,30);
        [self addSubview:_collection];
    }
    return _collection;
}

- (UIButton *)skinnable{
    if (!_skinnable) {
        _skinnable = [UIButton buttonWithType:UIButtonTypeCustom];
        _skinnable.frame = CGRectMake(CGRectGetMaxX(_collection.frame)+20, CGRectGetMaxY(_headView.frame)+20,30,30);
        [self addSubview:_skinnable];
    }
    return _skinnable;
}

- (UITableView *)optionalList{
    if (!_optionalList) {
        _optionalList = [[UITableView alloc] initWithFrame:CGRectMake(10,220 * ([UIScreen mainScreen].bounds.size.height / 667.0),280 * ([UIScreen mainScreen].bounds.size.width / 375.0), 300 * ([UIScreen mainScreen].bounds.size.height / 667.0)) style:UITableViewStylePlain];
        _optionalList.backgroundColor = [UIColor clearColor];
        [self addSubview:_optionalList];
    }
    return _optionalList;
}

- (UIImageView *)bottomView{
    if (!_bottomView) {
        _bottomView = [[UIImageView alloc] initWithFrame:CGRectMake(0, CGRectGetHeight(self.frame) - 80 * ([UIScreen mainScreen].bounds.size.height / 667.0), 300 * ([UIScreen mainScreen].bounds.size.width / 375.0), 80 * ([UIScreen mainScreen].bounds.size.height / 667.0))];
        _bottomView.userInteractionEnabled = YES;
        [self addSubview:_bottomView];
    }
    return _bottomView;
}

- (UIImageView *)radioView{
    if (!_radioView) {
        _radioView = [[UIImageView alloc] initWithFrame:CGRectMake(15* ([UIScreen mainScreen].bounds.size.width / 375.0),15 * ([UIScreen mainScreen].bounds.size.height / 667.0), 50* ([UIScreen mainScreen].bounds.size.width / 375.0), 50* ([UIScreen mainScreen].bounds.size.width / 375.0))];
        _radioView.userInteractionEnabled = YES;
        [_bottomView addSubview:_radioView];
    }
    return _radioView;
}

- (UILabel *)radioTheme{
    if (!_radioTheme) {
        _radioTheme = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(_radioView.frame) + 10,15* ([UIScreen mainScreen].bounds.size.height / 667.0),160, 20)];
        _radioTheme.font = [UIFont systemFontOfSize:13];
        [_bottomView addSubview:_radioTheme];
    }
    return _radioTheme;
}

- (UILabel *)radioSummary{
    if (!_radioSummary) {
        _radioSummary = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(_radioTheme.frame),CGRectGetMaxY(_radioTheme.frame),CGRectGetWidth(_radioTheme.frame), 20)];
        _radioSummary.numberOfLines = 0;
        _radioSummary.font = [UIFont systemFontOfSize:12];
        [_bottomView addSubview:_radioSummary];
    }
    return _radioSummary;
}

- (UIButton *)playOrPause{
    if (!_playOrPause) {
        _playOrPause = [UIButton buttonWithType:UIButtonTypeCustom];
        _playOrPause.frame = CGRectMake((CGRectGetMaxX(_radioTheme.frame) + 10) * ([UIScreen mainScreen].bounds.size.width / 375.0),25*([UIScreen mainScreen].bounds.size.height / 667.0), 30, 30);
        [_bottomView addSubview:_playOrPause];
    }
    return _playOrPause;
}

@end
